<table class="table table-border table-bordered table-hover table-bg">
	<thead>
		<tr class="text-c">
			<th width="25"><input type="checkbox" value="" name=""></th>
			<th>客人姓名</th>
			<th>联系方式</th>
			<th>性别</th>
			<th>信用等级</th>
			<th>紧急联系人</th>
			<th>紧急联系方式</th>
			<th>操作员</th>
			<th>状态</th>
			<th>账号类型</th>
			<th>注册时间</th>
			<th width="50">操作</th>
		</tr>
	</thead>
	<tbody>
		<?php if(is_array($userlist) && count($userlist)){ ?>
		<?php foreach($userlist as $k=>$user){ ?>
		<tr class="text-c">
			<td><input type="checkbox" value="{$user['userid']}" name=""></td>
			<td>{$user['nickname']}</td>
			<td>{$user['phone']}</td>
			<td>{$user['sex'] == 1 ? '男' : '女'}</td>
			<td class="text-c">
				<div class="clearfix">
					<div class="star-bar star-bar-show size-S f-l va-m mr-10">
						<span class="star star-1"></span>
					</div>
				</div>
			</td>
			<td>{$user['emergency_name']}</td>
			<td>{$user['emergency_phone']}</td>
			<td>{$user['admin_nick']}</td>
			<td>
				<span class="select-box radius" style="width: 80px">
				  	<select class="select mstatus" size="1" user_id="{$user['userid']}">
					  	<option value="1" <?php echo $user['visible'] == 1 ? 'selected' : ''; ?>>正常</option>
					  	<option value="0" <?php echo $user['visible'] == 0 ? 'selected' : ''; ?>>禁用</option>
				  	</select>
				</span>		
			</td>
			<td>{$user['login_type'] == 1 ? '平台账号' : '三方账号'}</td>
			<td>{$user['createtime']|date="Y-m-d H:i", ###}</td>
			<td>
				<a href="javascript:void(0);" title="编辑" onclick="admin_role_edit('编辑用户信息','add.html?userid={$user['userid']}', 1,'920', '500');" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
			</td>
		</tr>
		<?php } }else{ ?>
		<tr class="text-c">
			<td colspan="19" >暂无数据...</td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<!--page-->
<include file="Common/page" />
<script>
	$(document).ready(function(){
		$(".mstatus").on('change', function(){
			var obj = $(this);
			var	user_id = obj.attr('user_id');
			var	status = $(this).val();
			
			var load = layer.load(2);
			$.post("setStatus.html",{userid: user_id, visible: status}, function(data){
				layer.close(load);
				if(data/1 == 1){
					layer.msg('设置成功', {icon:1, time: 2000});
				}else{
					layer.msg('设置失败', {icon:2, time: 2000});
				}
			});
		});

	});
</script>